import os

import pytest

from tools.logger import logger
from tools.send import send_email
if __name__ == '__main__':
    logger()
    """allure报告"""
    pytest.main([r'D:\gaosi_xm\PythonProject40\testCase\testCase.py','-s',
                 '--clean-alluredir','--alluredir=./report'])
    os.system('allure generate ./report o ./html --clean')
    """html报告"""
    pytest.main([r'D:\gaosi_xm\PythonProject40\testCase\testCase.py',
                 '--html=report.html','--self-contained-html'])
    # 附件包含日志文件和测试报告
    send_email([r'D:\gaosi_xm\PythonProject40\log.txt'
                   ,r'D:\gaosi_xm\PythonProject40\allure-report\index.html'
                ,r'D:\gaosi_xm\PythonProject40\report.html'])